def averageOfListBelowN(list: List[Int], n: Int): Double = {
  val sum_List = list.filter(_ < n)
  if (sum_List.isEmpty) {
    0
  } else {
    sum_List.sum.toDouble / sum_List.length.toDouble
  }
}
